package cn.xluobo.business.wechat.miniapp.teacher.controller;

import cn.xluobo.business.sys.staff.domain.req.ReqSearchStaff;
import cn.xluobo.business.sys.staff.domain.resp.RespBusinessStaffDetail;
import cn.xluobo.business.wechat.miniapp.teacher.domain.resp.RespIndexBarStaff;
import cn.xluobo.business.wechat.miniapp.teacher.service.WechatMiniStaffService;
import cn.xluobo.core.api.APIResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ：KingLong
 * @date ：Created in 2020/11/12 08:38
 */
@RestController
@RequestMapping("/api/wechat/miniapp/{appId}/staff")
public class WechatMiniStaffController {

    @Autowired
    private WechatMiniStaffService wechatMiniStaffService;

    /**
     * 员工index bar列表
     * @param reqSearchSysStaff
     * @return
     */
    @GetMapping("/searchIndexBarStaffList")
    public APIResponse searchIndexBarStudentList(ReqSearchStaff reqSearchSysStaff) {
        List<RespIndexBarStaff> indexBarStaffList = wechatMiniStaffService.searchIndexBarStaffList(reqSearchSysStaff);
        return APIResponse.toAPIResponse(indexBarStaffList);
    }

    /**
     * 员工详情
     * @param staffId
     * @return
     */
    @GetMapping("/staffDetail/{staffId}")
    public APIResponse detailById(@PathVariable("staffId") Long staffId) {
        RespBusinessStaffDetail businessStaffDetail = wechatMiniStaffService.detailById(staffId);
        return APIResponse.toAPIResponse(businessStaffDetail);
    }

}
